package com.mapper;

import com.pojo.Agreer;
import com.pojo.Indent;
import com.pojo.Measurement;
import com.pojo.State;
import org.apache.ibatis.annotations.Param;

import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface IndentMapper {
//    查询销售经理提交审批订单可模糊查询
    List<Map<String,Object>> indentFindManager(@Param("ename") String ename,@Param("iid")Integer iid,@Param("firm") String firm,@Param("roleid") Integer roleid);

    //    查询所有订单状态
    List<Map<String,Object>> indentFindAll(@Param("ename") String ename,@Param("iid")Integer iid,@Param("firm") String firm);

    //    查询老板审批付款订单
    List<Map<String,Object>> indentFindBoss(@Param("ename") String ename,@Param("iid")Integer iid,@Param("firm") String firm,@Param("roleid") Integer roleid);

//    采购员只能查看自己提交的订单
List<Map<String,Object>> indentFindBuyer(@Param("ename") String ename,@Param("iid")Integer iid,@Param("firm") String firm,@Param("empno") Integer empno);

//    创建采购订单
    List<Measurement> measurementSelect(@Param("mid")Integer mid,@Param("mbig")String mbig,@Param("scale")Integer scale,@Param("mlittle")String mlittle);
    int measurementInsert(Measurement measurement);
    List<State> stateSelect(@Param("staid")Integer staid);
    int stateInsert(Integer staid);
    List<Indent>indentSelect(@Param("iid")Integer iid);
    int indentInsert(Indent indent);

//    经理审批修改
    int rankUpd(@Param("iid") Integer iid,@Param("rank") Integer rank);
    int managerUpd(@Param("staid") Integer staid,@Param("manager") Integer manager,@Param("payment") Integer payment);
    List<Agreer>agreerSelect(@Param("agrid")Integer agrid);
    int agreerInsert(Agreer agreer);

    //    修改订单数量
    int indentUpdNum(@Param("iid") Integer iid,@Param("num") Integer num);

    //    修改交货日期
    int indentUpdDt(@Param("staid") Integer staid,@Param("deliveryTime") Date deliveryTime);

//    订单确认，等待付款
    int indentUpdAffirm(@Param("iid") Integer iid,@Param("rank") Integer rank);

    //查看财务
    List<Map<String,Object>> indentFindFinance(@Param("roleid") Integer roleid);

//        财务确认，付款完成
    int stateUpdPayment(@Param("staid") Integer staid,@Param("payment") Integer payment);

//    取消订单
    int indentDel(Integer iid);
    int measurementDel(Integer mid);
    int stateDel(Integer staid);

    //保管员可查看订单
    List<Map<String,Object>> indentVerify(@Param("roleid") Integer roleid);

//    实际到货数量
    int indentUpdFact(@Param("iid") Integer iid,@Param("fact") Integer fact);

//    保管员确定后修改接 核 结 截
    int stateUpdRVEE(@Param("staid") Integer staid,@Param("verify") Integer verify,@Param("endTime") Date endTime);
}
